/*
Date:20210529 22:54PM
key:排序，逐个i,j头尾和遍历一次取最大
*/
class Solution {
public:
    int minPairSum(vector<int>& nums) 
    {
        sort(nums.begin(),nums.end());
        int Max=INT_MIN;
        int i=0,j=nums.size()-1;
        
        while(i<j)
        {
            Max=max(Max,nums[i]+nums[j]);
            i++;
            j--;
        }
        return Max;
    }
};